package algorithms

import (
	"container/list"
	"fmt"
)

func TraversList(lst *list.List) {
	current := lst.Front()
	for current.Next() != nil {
		fmt.Println(current.Value)
		current = current.Next()
	}
	fmt.Println(current.Value)
}

func ReverseTraverse(lst *list.List) {
	current := lst.Back()
	for current.Prev() != nil {
		fmt.Println(current.Value)

		current = current.Prev()
	}
	fmt.Println(current.Value)
}
